package com.fy.dao;

import com.fy.entity.Goods;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsMapper {
    @Select("select * from goods")
    List<Goods> findAll();

    @Select("select * from goods where go_id=#{go_id}")
    List<Goods> getInfo(@Param("go_id") String go_id);

    @Insert("insert into goods(go_id, info_id, go_fm, go_pic, go_info, go_title, go_type) VALUES ( #{go_id},#{info_id},#{fo_fm},#{go_pic},#{go_info},#{go_title},#{go_type})")
    int insert_goods(@Param("go_id")String go_id, @Param("info_id")String info_id,
                     @Param("go_fm")String go_fm, @Param("go_pic")String go_pic,
                     @Param("go_info")String go_info,
                     @Param("go_title")String go_title, @Param("go_type")String go_type);
}
